Copyright: Copyright, © The Programmers' Guild


About
We can be reached:

by e-mail:

feedback@programmersguild.com

by snail mail:

The Programmers' Guild

7 Main Street

St. George, N.B.

Canada

E0G 2Y0

on the web at

http://www.programmersguild.com/

Feel free to contact us with any comments or criticisms.


Active Property

See Also	Example

Declaration

property Active: Boolean

Description

Set the Active property to True to add an Icon to the Windows 95 Tray.  Set the Active property to False to remove the Icon from the Windows 95 Tray.  Changing the Active property is equivalent to calling the ShowIcon or HideIcon methods.


Additional Notes

1. For information on how to hide your application on initial startup, click here.

2.  To modify the double click interval (the time interval used to determine the difference between single and double click events) used by the TrayIcon set the global Unit variable PGTrayIconDoubleClickTime.  It's default value is 400 milliseconds.


Animated TrayIcon VCL for Delphi
Animated TrayIcon VCL v3.0 for Delphi 1.0, 2.0, 3.0 and C++ Builder 1.0

Properties	Methods	Events	Registration	Frequently Asked Questions

The Animated TrayIcon VCL© is a component you can use in Delphi 1.0, 2.0, 3.0 and C++ Builder 1.0 to add icons to the Windows 95 / Windows NT system tray.   To find out what's new in v3.0, click here.  For detailed information on the benefits of registering this component, click here.

Icons can be added to the tray by setting the Active property to True, and can be removed from the tray by setting the Active property to false.  Tray Icons can also be added or removed from the tray by using the ShowIcon and HideIcon methods.

Whether the Tray Icon is enabled, disabled, or animated when being displayed in the tray is determined by the value of the State property.  To monitor changes in the Tray Icon's state, assign a method to the OnStateChanging event.

To respond to mouse events for the icon, use the OnClick, OnDblClick, OnMouseMove, OnMouseEnter and OnMouseExit events in conjunction with the ClickedMouseButton property.

To have your application automatically minimize itself to the system tray, check out the Options property.  To have your application respond to being Minimized, or Restored from a minimized state, use the OnAppMinimize and OnAppRestore events.  For information on how to hide your application on initial startup, click here.

To display a pop-up menu when the user clicks the right mouse button on the Tray Icon, assign a PopupMenu component to the icons PopupMenu property and set the AutoPopup property to True.

To display a Help Hint whenever the mouse pointer pauses over the icon momentarily, set the Hint property to a help string, and set the ShowHint property to True.

Please check out these Additional Notes for more information.

In addition to these properties, methods, and events, this component also has the properties and methods that apply to all components.


Animation Property

See Also	Example

Declaration

property Animation: TPGTrayIconAnimation

Description

The Animation property is used to define the animation that will occur when a Tray Icon has it's State property set to tsAnimated.  The icons to be used in the animation are listed in the Icons property, and the time to wait between animation frames and the OnAnimation event is specified by the Interval property.  The Options property allows you to choose whether the animation icons are loaded from icon files or from icons contained in your application's executable.

For more information see the TPGTrayIconAnimation topic.


AutoPopup Property

Example

Declaration

property AutoPopup: Boolean

Description

The AutoPopup property determines if a pop-up menu appears when the user clicks the right mouse button over the icon in the Windows 95 tray. If AutoPopup is True, a right click displays the pop-up menu. If AutoPopup is False, the menu won't appear when the user clicks the right mouse button. The default value is True.  To display a pop-up menu when AutoPopup is False, you must use the Popup method.

Note: If the icon has a right click event assigned, and AutoPopup is True, the AutoPopup property overrides the right click event, and the popup menu will be displayed.


ClickedMouseButton Property

See Also	Example

Declaration

property ClickedMouseButton: TMouseButton;

Description

The read only ClickedMouseButton property determines the mouse button that was used to fire an OnClick or OnDblClick event.


Copyright / License / Warranty

TPGTrayIcon95 Component® Copyright © 1996 by The Programmers' Guild

All rights reserved.

License Agreement

You should carefully read the following terms and conditions before using this software.  Unless you have a different license agreement signed by The Programmers' Guild your use of this software indicates your acceptance of this license agreement and warranty.

For information on distributing the shareware evaluation version of the TPGTrayIcon95 Component see the section titled Shareware License.

Registered Version

One registered copy of TPGTrayIcon95 Component may either be used by a single person who uses the software personally on one or more computers, or installed on a single workstation used non simultaneously by multiple people, but not both.

You may access the registered version of the TPGTrayIcon95 Component through a network, provided that you have obtained individual licenses for the software covering all workstations that will access the software through the network.  For instance, if 8 different workstations will access the TPGTrayIcon95 Component on the network, each workstation must have its own TPGTrayIcon95 Component license, regardless of whether they use the TPGTrayIcon95 Component at different times or concurrently.

Good data processing procedure dictates that any program be thoroughly tested with non-critical data before relying on it.  The user must assume the entire risk of using the program.  ANY LIABILITY OF THE SELLER WILL BE LIMITED EXCLUSIVELY TO PRODUCT REPLACEMENT OR REFUND OF PURCHASE PRICE.


Credit Card Ordering Information

MasterCard, Visa, American Express, and Discover orders can be placed through the Public software Library (PsL) using product id# 14772.  Register the component for $10 US or obtain the complete source code for only $25 US.  Note: An additional 5$ US charge is applied to all credit card transactions.  Normally orders are received from PsL the same day orders are placed.  Registered versions are then delivered vie e-mail the following business day.

Note: The Programmers' Guild cannot be reached at the following numbers.  These numbers are for PsL, a credit card order taking service only.  Any questions about the status of the shipment of an order, refunds, registration options, product details, technical support, volume discounts, dealer pricing, site licenses, etc., must be directed to The Programmers' Guild.

You can reach PsL 24 hours a day 7 days a week

	by Fax at 1-713-524-6398
	by calling 1-800-2424-PsL or 1-713-524-6394 between 7:00 am and 6:00 pm CST Monday-Thursday and 7:00 am and 12:30 pm CST on Fridays, except holidays.
	by CompuServe mail to 71355,470, or by Internet mail to 71355.470@compuserve.com
	by postal mail to PsL at P.O. Box 35705, Houston, TX 77235 USA.
PsL requires the following information to process an order:

(Note:  Refer to Product id #14772 when ordering this product.)

E-Mail Address:___________________________________________

Credit Card: [ ]MasterCard  [ ]VISA  [ ]AMEX  [ ]Discover

Credit Card Number:_______________________________________

Expiration Date:__________________________________________

Name On Card:_____________________________________________

Mailing Address:__________________________________________


DisabledIcon Property

See Also	Example

Declaration

property DisabledIcon: TIcon

Description

The DisabledIcon property determines the icon that is displayed when the tray icon is active and disabled.


Events

 Key events

  OnAnimation

  OnAppMinimize

  OnAppRestore

  OnClick

  OnDblClick

  OnMouseMove

  OnStateChanging

  OnMouseEnter

  OnMouseExit


Example Active
Example

This code shows a Tray Icon:

procedure TForm1.Button1Click(Sender: TObject);

begin

  { Show the icon in the Windows 95 tray. }

  TrayIcon.Active := True;

end;

This code hides a Tray Icon:

procedure TForm1.Button1Click(Sender: TObject);

begin

  { Hide the tray icon if it is showing.  If it is not showing, do nothing. }

  TrayIcon.Active := False;

end;


Example AutoPopup
Example

This code causes a menu to be popped up when the tray icon is clicked at run time.

procedure TForm1.FormCreate(Sender: TObject);

begin

  { Setup a Tray Icon to display a popup menu when it is right clicked. }

  TrayIcon.AutoPopup := True;

  TrayIcon.PopupMenu := PopupMenu1;

end;


Example ClickedMouseButton
Example

This code displays a message when the TrayIcon is clicked, showing the mouse button that was used to fire the OnClick event.

procedure TMainForm.TrayIconClick(Sender: TObject);

var

  AMsg: string;

begin

  { Figure out which mouse button was clicked. }

  case TrayIcon.ClickedMouseButton of

    mbLeft:   AMsg := 'Left Single Click !!!';

    mbMiddle: AMsg := 'Middle Single Click !!!';

    mbRight:  AMsg := 'Right Single Click !!!';

  end;

  { Respond to the icon begin double clicked. }

  MessageDlg(AMsg, mtInformation, [mbOk], 0);

end;


Example DisabledIcon
Example

This code displays a disabled Tray Icon in the system tray.

procedure TForm1.Button1Click(Sender: TObject);

begin

  TrayIcon.DisabledIcon.LoadFromFile('MYICON.ICO');

  TrayIcon.State := tsDisabled;

  TrayIcon.ShowIcon;

end;


Example HideIcon
Example

This code hides the Tray Icon when a button is clicked:

procedure TForm1.Button1Click(Sender: TObject);

begin

  { Hide the tray icon if it is showing.  If it is not showing, do nothing. }

  TrayIcon.HideIcon;

end;


Example Icon
Example

This code displays an enabled Tray Icon in the system tray.

procedure TForm1.Button1Click(Sender: TObject);

begin

  TrayIcon.Icon.LoadFromFile('MYICON.ICO');

  TrayIcon.State := tsEnabled;

  TrayIcon.ShowIcon;

end;


Example IconIndex
Example

The following displays the name of the icon that is currently being displayed by the animation as the hint of the Tray Icon.

procedure TForm1.PrinterTrayIconAnimation(Sender: TObject);

begin

  { Set the hint to the name of the current icon in the animation. }

  TrayIcon.Hint := TrayIcon.Animation.Icons[TrayIcon.Animation.IconIndex];

end


Example OnAnimation
Example

Windows 95 comes with a built in Tray Icon that is used to monitor modem activity.  Whenever the modem is busy, the Tray Icon displays an animation of a modem with flashing lights, informing the user that the modem is busy transmitting data.  If this Modem tray icon had been programmed using the TPGTrayIcon95 component, then the OnAnimation event could have been used to stop the animation once the transmission was complete, as in the following code sample.

procedure TForm1.ModemTrayIconAnimation(Sender: TObject);

begin

  { Stop the animation once the modem transmission has completed. }

  if not Modem.Busy then

    ModemTrayIcon.State := tsEnabled;

end;


Example OnMouseMove
Example

The following code sample.shows the cursors coordinates in a status bar on the main form.

procedure TForm1.TrayIconMouseMove(Sender: TObject; Shift: TShiftState;

  X, Y: Integer);

begin

  { Display the cursor coordinates in the status bar. }

  StatusBar.SimpleText := Format('Cursor at: %d,%d', [X,Y]);

end;


Example OnStateChanging
Example

The following intercepts the change of state to allow only 2 states, enabled and disabled.

procedure TForm.TrayIconStateChanging(Sender: TObject;

  var NewState: TPGTrayIconState);

begin

  { Don't allow the animated state to occur. }

  if NewState = tsAnimated then

    NewState := tsEnabled;

end


Example Options
The following examples load a tray icon with enabled, disabled and animated icons.  The first example loads the icons from icon resources contained in the current executable.  The second example loads the icons from external icon files.

Example 1:  Loading icons from an executable.

  { Tell the TrayIcon that the icons to be used in the }

  { animation are icon resources that are included in }

  { the current executable.  While the above Icon and DisabledIcon }

  { properties required us to use the LoadIcon API call to load }

  { an icon from the executable, the Animation property takes care }

  { of these details "behind the scenes", once it is has been }

  { told where to look. }

  TrayIcon.Animation.Options := aoIconsInExe;

  TrayIcon.Animation.Icons.Clear;

  TrayIcon.Animation.Icons.Add('LIGHTON');

  TrayIcon.Animation.Icons.Add('LIGHTON');

  TrayIcon.Animation.Icons.Add('LIGHTOFF');

  TrayIcon.Animation.Icons.Add('LIGHTOFF');

  TrayIcon.Animation.Icons.Add('LIGHTON');

  TrayIcon.Animation.Icons.Add('LIGHTOFF');

  TrayIcon.Animation.Icons.Add('LIGHTON');

  TrayIcon.Animation.Icons.Add('LIGHTOFF');

  { Make the animation of the light bulb flashing on and off }

  { a "fast" animation. }

  TrayIcon.Animation.Interval := 150;

Example 2:  Loading icons from external icon files.

  { Set the icons that will be displayed when the }

  { TrayIcon is in its enabled and disabled states. }

  TrayIcon.Icon.LoadFromFile('TRASH3.ICO');

  TrayIcon.DisabledIcon.LoadFromFile('NOTRASH.ICO');

  { Tell the TrayIcon that the icons to be used in the }

  { animation are icon files. }

  TrayIcon.Animation.Options := aoIconsAreFiles;

  TrayIcon.Animation.Icons.Clear;

  TrayIcon.Animation.Icons.Add('TRASH1.ICO');

  TrayIcon.Animation.Icons.Add('TRASH2.ICO');

  TrayIcon.Animation.Icons.Add('TRASH3.ICO');

  { Make the animation of the fire burning in the trashcan }

  { a "fast" animation to simulate the flickering of a fire. }

  TrayIcon.Animation.Interval := 150;


Example ShowIcon
Example

This code shows a Tray Icon when a button is clicked:

procedure TForm1.Button1Click(Sender: TObject);

begin

  { Show the icon in the Windows 95 tray. }

  TrayIcon.ShowIcon;

end;


Example ShowPopupAtCursor
Example

This code displays the Tray Icon's popup menu when the Tray Icon is left clicked.

procedure TForm1.TrayIconClick(Sender: TObject);

begin

  { Display the popup at the cursor position. }

  TrayIcon.ShowPopupAtCursor;

end;


Example State
Example

This code animates a Tray Icon when a button is clicked:

procedure TForm1.Button1Click(Sender: TObject);

begin

  { Animate an icon in the Windows 95 tray. }

  TrayIcon.State := tsAnimated;;

  TrayIcon.ShowIcon;

end;


FAQ - Question 1
I want to be able to start my application with the main form of the application hidden.  Is this possible ?

Many people ask this question because it is key to the nature of how a tray icon is typically used.  The following source code is taken directly from the Demo application that accompanies this component, and contains a robust solution to this problem.  To view this code in the Demo project, open the project and select the View | Project Source menu option.

The areas that have been changed from a "normal" project source have been highlighted in bold.  Modifying your project source as detailed below will automatically hide your application on initial startup.

program Demo;

{ NOTE: This project source has been modified to force the Application  }

{ to be hidden when it loads. }

uses

  { 1. The following line MUST be the first line in the uses clause to force }

  { the Application to be hidden on startup. }

  {$IFDEF WIN32} PGHide32,PGTray95, {$ELSE} PGTray95, {$ENDIF}

  Forms,

  WinTypes,

  WinProcs,

  Main in 'MAIN.PAS' {MainForm};

{$R *.RES}

begin

  Application.Title := 'Animated TrayIcon VCL for Delphi and C++ Builder';

  Application.CreateForm(TMainForm, MainForm);

  { 2. Put the following line in place of the Application.Run line }

  { normally found here in the project source. }

  RunTrayApplication;

end.


FAQ - Question 2
Is it possible to use 16x16 icons with the TPGTrayIcon95 component ? If so, how ?

The TPGTrayIcon95 component provides support for icons through the standard TIcon object that is part of Delphi.  Since all a Delphi TICON is doing is encapsulating a Windows HICON, you get the support for icons that that version of Delphi knew how to support.  Delphi 1.0 was built for Windows 3.1 and knows how to work with Windows 3.1 style resource files.  Delphi 2.0 was built for Windows 95 and knows how to work with Windows 95's extended resource files. (i.e. the extended icon resource file format)

To summarize, you can use 16x16 icons with the TPGTrayIcon95 component in Delphi 2.0, but not in Delphi 1.0.

Note:  You can use the "Image Editor" program that comes with Delphi 2.0 to create 16x16 icons that you can use with the TPGTrayIcon95 component.


FAQ - Question 3
Where can I find more sample applications that use the Animated TrayIcon VCL ?

Periodically we provide samples that provide answers to commonly asked questions on our web site.

For more information on how to reach us, click here.


FAQ - Question 4
Can I use the same Delphi project for both Delphi 1.0 and 2.0 ?

You can recompile a Delphi 1.0 project into a full 32-bit application by recompiling it with Delphi 2.0 provided that you are using components that are supported in both versions of Delphi.  The TPGTrayIcon95 2.0 VCL comes complete with both Delphi 1.0 and 2.0 versions of the component.

Note:  You should maintain a different DPR project file for each version of Delphi due to the difference in RES resource file formats between Windows 3.1 and Windows 95.

For more information about migrating to Delphi 2.0 see the INFO\BORLAND\D32_INFO.DOC file on your Delphi CD.


FAQ - Question 5
Why should I register the Animated TrayIcon VCL ???

1. Advanced Product Features:

The Programmers' Guild is committed to making the Animated TrayIcon VCL the best TrayIcon component available for Delphi and C++ Builder.  We currently support the following advanced features:

- Built in Animation, Enabling and Disabling support.  Animate, Enable and Disable your TrayIcon with a single line of code !!!

- Support for OnMouseEnter and OnMouseExit events.  Useful for those times when the OnMouseMove event is overpowering your application.

- Display PopupMenu's without writing a single line of code !

- Documented solutions for completely hiding your Application on initial start up without flashing the Application's TaskBar icon.

- Solution to the "Sticky" menu problem associated with Popup Menu's and the system tray.

- Automatic "uncluttering" of the Windows 95 / NT TaskBar in Delphi 1.0 by hiding of all non MainForm TaskBar icons.

- Complete support for Windows 95 and Windows NT 4.0 (both 16 bit and 32 bit components).

- Sample Icon library to help you get started in creating Enabled and Disabled versions of your applications icons.

- Fully documented demo application, complete with help file and manual.

2. Can be used in Delphi 1.0, 2.0, 3.0 and C++ Builder 1.0:

- This feature is useful to people that only own Delphi 1.0, or are supporting a 16 bit application due to 16 bit legacy code (e.g. Their application requires VBX's).  Once a port to 32 bit can be made, our TrayIcon component seemlessly upgrades to Delphi 2.0, 3.0 and C++ Builder without a hitch !!!

3. Both Minor and Major Upgrades for Free !!!:

- Last but not least, to ensure that our customers stay satisfied with their purchase, we supply ALL future upgrades for free.  Think of the time you'll save by letting us port to new versions of Windows 95 and Windows NT !!!

Click here for information on how to order.


Form Property

Declaration

property Form: TForm;

Description

The read-only Form property supplies the TrayIcon with a convenient reference to it's parent form.  Note that all TrayIcon's must be owned by a Form, so you can correctly assume that this reference will always be valid.


Frequently Asked Questions

1. I want to be able to start my application with the main form of the application hidden.  Is this possible ?

2. Is it possible to use 16x16 icons with the TPGTrayIcon95 component ? If so, how ?

3. Where can I find more sample applications that use the Animated TrayIcon VCL ?

4. Can I use the same Delphi project for both Delphi 1.0 and 2.0 ?

5. Why should I register ???

6. What new features have been added to the latest version ???


Handle Property

Declaration

property Handle: THandle;

Description

The read-only Handle property is the window handle to which all TrayIcon messages are directed.  It is also used in conjunction with the NotifyShell method to send TrayIcon requests to Windows.


HideApplication Method

See Also

Declaration

procedure HideApplication;

Description

The HideApplication method hides your application and all visible forms by:

- Hiding the Application's TaskBar icon.

- Minimizing the application, which causes all visible forms to be "hidden".

This in effect causes your application to become an "invisible" task.


HideIcon Method

See Also	Example

Declaration

procedure HideIcon;

Description

The HideIcon method removes an icon from the Windows 95 tray.  It is equivalent to setting the Active property to False.


History
Version History

Version   Date(d/m/y)   Programmer    Comments

1.0       06/03/96      Brad Parks    Creation.

2.0       20/05/96      Brad Parks    Added the State and Animation

                                      properties, as well as the ability

                                      to use the component in Delphi 1.0

                                      and Delphi 2.0.

2.1       18/06/96      Brad Parks    Exposed a new method to display the

                                      popup menu at the position of the

                                      cursor, "ShowPopupAtCursor".

2.2       26/08/96      Brad Parks    Fixed a bug in the Delphi 2 version

                                      of the component that stopped the

                                      reception of tray messages.

                                      Also introduced the "MouseOver"

                                      event, the "ShowApplication" and

                                      "HideApplication" methods, and

                                      made the popup menu "non sticky"


Icon Property

See Also	Example

Declaration

property Icon: TIcon

Description

The Icon property determines the icon that is displayed when the tray icon is active and enabled.


IconIndex Property

See Also	Example

Applies to

TPGTrayIconAnimation

Description

Run-time only. The value of the IconIndex property tracks the icon that is currently being displayed when a Tray Icon is being animated.


Icons Property

See Also	Example

Applies to

TPGTrayIconAnimation

Description

The Icons property is used to specify the icons that will be used in a Tray Icon animation.  It is either a list of icon filenames, or a list of icon resource names for icons that will are included in the executable. You can specify where the icons are located using the Options property.  If an icon cannot be loaded, the Tray Icon will display the last icon that was successfully loaded in it's place, and will continue with the next icon in the animation sequence at the next time interval.


Installation

Delphi 1.0 and 2.0 Installation:

Before you can use the Animated TrayIcon VCL, you must install the component into the Delphi palette and rebuild the component library. From within Delphi, do the following:

1) Select Component|Install from the main menu (Options|Install components for Delphi 1.0).

2) Select 'Add', and then select the 'Browse' button.

3) Locate and select the PGTRAY95.PAS or PGTRAY95.DCU file in the installation directory and select the OK button from the 'Add Module' dialog.

6) Select OK from the 'Install Components' dialog to have Delphi compile and add the Animated TrayIcon VCL to the component library.

Delphi 3.0 Installation:

The Animated TrayIcon VCL design-time package is automatically installed into Delphi 3.0 if the Animated TrayIcon VCL was installed using the setup program.

C++ Builder Installation:

Before you can use the Animated TrayIcon VCL you must install the component into the C++ Builder palette and rebuild the component library. From within C++ Builder, do the following:

1) Select Options|Environment from the main menu.

2) Select the "Library" tab.

3) Append the installation directory of the PGTRAY95.PAS or PGTRAY95.OBJ file to the "Include Path" and the "Library Path" edit fields.

4) Select OK

5) Select Component|Install from the main menu

6) Select 'Add', and then select the 'Browse' button.

7) Locate and select the PGTRAY95.PAS or PGTRAY95.OBJ file in the installation directory and select the OK button from the 'Add Module' dialog.

8) Select OK from the 'Install Components' dialog to have C++ Builder compile and add the Animated TrayIcon VCL to the component library.

If you have any problems with this installation, please contact The Programmers' Guild for technical support.


Interval Property

See Also

Applies to

TPGTrayIconAnimation

Declaration

property Interval: Word

Description

The Interval property determines in milliseconds the amount of time that passes between frames of a Tray Icon animation.

Note: You can specify any value between 0 and 65,535 as the interval value, but the animation will not occur if you specify a value of 0.


Methods

 Key methods

  ShowIcon

  HideIcon

       Refresh

       ShowPopupAtCursor

       ShowApplication

       HideApplication


OnAnimation Event

See Also	Example

Applies to

TPGTrayIcon95

Declaration

property OnAnimation: TNotifyEvent

Description

The OnAnimation event is used to execute code at regular intervals during a Tray Icon animation. Place the code you want to execute within the OnAnimation event handler.  This event is frequently used to stop the animation once a condition has been met.

Note:  You can use the IconIndex property of the Animation object to find out which icon in the icon list is currently being displayed in the tray.  Click here for an example.


OnAppMinimize Event

Applies to

TPGTrayIcon95

Declaration

property OnAppMinimize: TNotifyEvent read FOnAppMinimize write FOnAppMinimize;

Description

The OnAppMinimize event is used to allow your application to respond to the Application's minimize event.

Note:  The Animated TrayIcon VCL uses the Applications' OnMinimize event to support hiding the application's TaskBar icon on minimization, and exposes this event to allow your application to process this event as you normally require.


OnAppRestore Event

Applies to

TPGTrayIcon95

Declaration

property OnAppRestore: TNotifyEvent read FOnAppRestore write FOnAppRestore;

Description

The OnAppRestore event is used to allow your application to respond to the Application's restore event.

Note:  The Animated TrayIcon VCL uses the Applications' OnRestore event to support showing the application's TaskBar icon on restoration, and exposes this event to allow your application to process this event as you normally require.


OnMouseEnter Event

See Also

Applies to

TPGTrayIcon95

Declaration

property OnMouseEnter: TMouseMoveEvent

Description

The OnMouseEnter event occurs when the user first moves the mouse pointer over a Tray Icon.

Note:  If you are interested in trapping all mouse movement messages while over a TrayIcon, use the OnMouseMove event.


OnMouseExit Event

See Also

Applies to

TPGTrayIcon95

Declaration

property OnMouseExit: TMouseMoveEvent

Description

The OnMouseExit event occurs when the user first moves the mouse pointer over a Tray Icon.

Note:  If you are interested in trapping all mouse movement messages while over a TrayIcon, use the OnMouseMove event.


OnMouseMove Event

See Also	Example

Applies to

TPGTrayIcon95

Declaration

property OnMouseMove: TMouseMoveEvent

Description

The OnMouseMove event occurs when the user moves the mouse pointer over a Tray Icon. Use the OnMouseMove event handler when you want something to happen when the mouse pointer is moving over the Tray Icon.


OnStateChanging Event

See Also	Example

Declaration

property OnStateChanging: TPGTrayIconStateChangingEvent

TPGTrayIconStateChangingEvent = procedure (Sender: TObject; var NewState: TPGTrayIconState) of object

Description

The OnStateChanging event is activated when the State property is about to be changed.  The NewState parameter contains the new value for the State property.  This parameter can be modified to allow you to choose the new state programmatically.

Note:  If you try and modify the State property in the OnStateChanging event, an EInvalidOperation exception will be raised.  If you want to change the State property in the OnStateChanging event, modify the NewState parameter of the event handler.


Options Property

See Also	Example

Applies to

TPGTrayIconAnimation

Declaration

property Options: TPGTrayIconAnimationOptions

Description

The Options property tells the Tray Icon component where the icons contained in the Icons property list are located.  These are the possible values of the Options property.

Value	Meaning

aoIconsAreFiles	The icon names contained in the Icons property are the names of icon files.  e.g. MYICON.ICO
aoIconsInExe	The icon names contained in the Icons property are the names of icon resources in the current executable.


Options Property for TrayIcon
Options Property

Declaration

property Options: TPGTrayIconOptions

Description

The Options property determines various options about how the TrayIcon operates:  These are the possible values:

Value	Meaning

toMinimizeToTray	When the application is minimized it will not display a TaskBar icon, and will appear to minimize to the system tray.
toUnclutterDelphi1TaskBar	Delphi 1.0 Specific.  Delphi 1.0 applications show a TaskBar icon for every form that is visible in the application.  Include this value in your TrayIcon's options to automatically hide the TaskBar icon of all forms except for the Application's MainForm.


Ordering Information/Order Form
Ordering Information

Animated TrayIcon VCL® The Programmers' Guild

Note: All Major and Minor upgrades are free and are available on our web site as soon as they are released !!!

Click here for information on the benefits of registering.  Please review the Shareware License before purchasing this product.

Ordering by Credit Card:

For information on ordering by MasterCard, Visa, American Express, or Discover by phone, FAX, email, or postal mail, click here.

CompuServe Registration:

To have the registration fee added to your CompuServe bill use the CompuServe command GO SWREG and follow the menus.  Register the component for $10 US SWREG 10488 or obtain the complete source code for only $25 US SWREG 10489.

Ordering Online:

To order online via secure web browser, visit http://www.programmersguild.com

Ordering by check:

To order by check send this order form and a check to The Programmers' Guild.  To print this order form, click on Print Topic in the File pull-down menu.  Payment must be in US dollars drawn on a US bank, or you can send international postal money orders in US dollars.

I would like to purchase:

____	copies of the component at $10 US each    = __________

____	copies of the source code at $25 US each  = __________

New Brunswick residents add 11% sales tax       = __________

Canadian residents add 7% GST                   = __________

                                Total payment	= __________

Name:         ______________________________________________

E-Mail:       ______________________________________________

Company:      ______________________________________________

Address:      ______________________________________________

City, State, Zip: __________________________________________

Country:      ______________________________________________

Day Phone:    ______________________________________________

Evening Phone:______________________________________________

Web Site:     ______________________________________________

How did you hear about the Animated TrayIcon VCL ?

____________________________________________________________

Comments:

____________________________________________________________

____________________________________________________________


Properties

Run-time only	 Key properties

Active	Handle
Animation	Icon
AutoPopup	Options
ClickedMouseButton	PopupMenu
DisabledIcon	ShowHint
Form	State
Hint


Refresh Method

Declaration

procedure Refresh

Description

The Refresh method is used to inform Windows that the Tray Icon has changed and that it should update it's display in the system tray.  Although this method is public, you should never need to call the Refresh method since it is used internally to ensure that modifying a property of the Tray Icon always results in an updated Tray Icon.


See Also Active
See Also

ShowIcon method

HideIcon method


See Also Animation
See Also

Icons property

Interval property

Options property

OnAnimation event

IconIndex property


See Also ClickedMouseButton
See Also

OnClick event

OnDblClick event


See Also DisabledIcon
See Also

Icon property

State property


See Also HideApplication
See Also

ShowApplication Method


See Also HideIcon
See Also

ShowIcon method

Active property


See Also Icon
See Also

DisabledIcon property

State property


See Also IconIndex
See Also

Animation property

Icons property

Interval property


See Also Icons
See Also

Options property


See Also Interval
See Also

State property


See Also OnAnimation
See Also

Animation property

IconIndex property

Icons property

Interval property


See Also OnMouseEnter
See Also

OnMouseExit event

OnMouseMove event


See Also OnMouseExit
See Also

OnMouseEnter event

OnMouseMove event


See Also OnMouseMove
See Also

OnMouseEnter event

OnMouseExit event


See Also OnStateChanging
See Also

State property


See Also Options
See Also

Animation property

Icons property


See Also ShowApplication
See Also

HideApplication method


See Also ShowIcon
See Also

HideIcon method

Active property


See Also ShowPopupAtCursor
See Also

PopupMenu property

AutoPopup property


See Also State
See Also

Icon property

DisabledIcon property

Animation property

OnStateChanging event


See Also TPGTrayIcon95
See Also

First thing to see

Second thing to see

Third thing to see


Shareware License

This license does not in anyway imply that you will have to pay royalty fees for the use of the Animated TrayIcon VCL in your applications.  It is intended to be a licence between The Programmers' Guild and developers that use the Animated TrayIcon VCL to build applications.  If you have 3 developers in your company that use the TrayIcon when building software, then you would require 3 licensed versions.  Any applications that are created with the TrayIcon can be distributed to any number of end users in any fashion that you see fit.

The use of this package indicates your understanding and acceptance of the following terms and conditions. This license shall supersede any verbal, or prior verbal or written, statement or agreement to the contrary. If you do not understand or accept these terms, or your local regulations prohibit "after sale" license agreements or limited disclaimers, you must cease and desist using this product immediately.

This product is © Copyright 1996 The Programmers' Guild, all rights reserved. This product is protected by Canadian and United States copyright laws, international treaties and all other applicable national or international laws. This software product and documentation may not, in whole or in part, be copied, photocopied, translated, or reduced to any electronic medium or machine readable form, without prior consent in writing, from The Programmers' Guild and according to all applicable laws. The sole owner of this product is The Programmers' Guild.

Liability disclaimer:

This product and/or license is provided as is, without any representation or warranty of any kind, either express or implied, including without limitation any representations or endorsements regarding the use of, the results of, or performance of the product, its appropriateness, accuracy, reliability, or correctness. The entire risk as to the use of this product is assumed by the user and/or licensee. The Programmers' Guild does not assume liability for the use of this program beyond the original purchase price of the software. In no event will The Programmers' Guild be liable for additional direct or indirect damages including any lost profits, lost savings, or other incidental or consequential damages arising from any defects, or the use or inability to use these programs, even if The Programmers' Guild have been advised of the possibility of such damages.

Restrictions:

You may not use, copy, modify, translate, or transfer the programs, documentation, or any copy except as expressly defined in this agreement. You may not attempt to unlock or bypass any "copy-protection" or authentication algorithm utilized by the program. You may not remove or modify any copyright notice or the method by which it may be invoked.

Operating license:

You have the non-exclusive right to use any enclosed program only by a single person, on a single computer at a time. You may physically transfer the program from one computer to another, provided that the program is used only by a single person, on a single computer at a time. In group projects where multiple persons will use the program, you must purchase an individual license for each member of the group. Use over a "local area network" (within the same locale) is permitted provided that the program is used only by a single person, on a single computer at a time. Use over a "wide area network" (outside the same locale) is strictly prohibited under any and all circumstances.

Linking and distribution license:

In order to link and distribute compiled TPGTrayIcon95 code in accordance to this license, you must be registered with The Programmers' Guild as an authorized licensee, and must have submitted a signed copy of this license stating you agree to be bound by its terms and conditions. You may not reproduce or distribute copies of the complete package, any of the source, interface, or code (.DCU) units, any of the documentation, nor may you supply any means by which your users could create, modify, or incorporate the TPGTrayIcon95 component in their own products. Violations will be prosecuted to the maximum extent possible under the law.

Back-up and transfer:

You may make one copy of the program solely for "back-up" purposes, as prescribed by Canadian, United States, and international copyright laws. You must reproduce and include the copyright notice on the back-up copy. You may transfer the product to another party only if the other party agrees to the terms and conditions of this agreement, and completes and returns registration information (name, address, etc.) to The Programmers' Guild within 30 days of the transfer. If you transfer the program you must at the same time transfer the documentation and back-up copy, or transfer the documentation and destroy the back-up copy. You may not retain any portion of the program, in any form, under any circumstance.

Terms:

This license is effective until terminated. You may terminate it by destroying the program, the documentation and copies thereof. This license will also terminate if you fail to comply with any terms or conditions of this agreement. You agree upon such termination to destroy all copies of the program and of the documentation, or return them to The Programmers' Guild for disposal.  Note that by registering this product you give The Programmers' Guild permission to reference your name in product advertisements.

Other rights and restrictions:

All other rights and restrictions not specifically granted in this license are reserved by The Programmers' Guild.


ShowApplication Method

See Also

Declaration

procedure ShowApplication;

Description

The ShowApplication method shows your application and the TrayIcon's parent form by:

- Showing the Application's TaskBar icon.

- Restoring the application, which causes all previously "hidden" forms to be restored to their previous state.

This in effect causes your application to become a "visible" task that is accessible via the TaskBar and by an Alt-Tab key sequence.


ShowIcon Method

See Also	Example

Declaration

procedure ShowIcon;

Description

The ShowIcon method adds an icon to the Windows 95 tray.  It is equivalent to setting the Active property to True.


ShowPopupAtCursor Method

See Also	Example

Declaration

procedure ShowPopupAtCursor

Description

The ShowPopupAtCursor method displays the tray icon popup at the current mouse position.  This method is typically used to display the popup menu when the tray icon is left clicked.


State Property

See Also	Example

Declaration

property State: TPGTrayIconState

Description

The State property determines the various states a Tray Icon will display when active.  These are the possible values:

Value	Meaning

tsEnabled	The Tray Icon will display the icon contained in its Icon property when active.
tsDisabled	The Tray Icon will display the icon contained in its DisabledIcon property when active.
tsAnimated	The Tray Icon will display an animation that is defined by the Animation property when active.

To monitor and intercept changes in the Tray Icon's state, assign a method to the OnStateChanging event.


TPGTrayIcon95 Unit
PGTray95 Unit

The PGTray95 unit contains the Delphi encapsulation of a Windows 95 Tray Icon.

The PGTray95 unit is automatically added to the uses clause whenever you use the TPGTrayIcon95 component.

The following items are declared in the PGTray95 unit:

Objects

TPGTrayIcon95

TPGTrayIconAnimation

To see a listing of items declared in this unit including their declarations, use the ObjectBrower.


TPGTrayIconAnimation

Properties

Applies to

TPGTrayIcon95

Description

The TPGTrayIconAnimation object is an encapsulation of a Tray Icon animation.  It deals with allocating a timer, changing the icon currently being displayed in the system tray, firing the OnAnimation event of the Tray Icon, and finally freeing the timer when the animation has been stopped.  The TPGTrayIcon95 VCL uses an instance of this component for it's Animation property.

You should never need to declare an instance of this object.


TPGTrayIconAnimation Properties
Properties

 Run-time only	  Key properties

  	Icons

 	IconIndex

  	Interval

  	Options


What's New
What's New ???

After much feedback from our users, the Animated TrayIcon VCL has added / updated the following new features:

- Automatic minimizing of an application to the system tray (instead of the TaskBar) by using the Options property, toMinimizeToTray.  Note that the TrayIcon now takes control of the Application.OnMinimize and Application.OnRestore events to make this work correctly, and supplies the OnAppMinimize and OnAppRestore events to allow developers to still intercept these application events.

- Robust solutions to hiding your application on Initial startup.  Click here for more information.

- Improved HideApplication and ShowApplication methods.  These methods now hide your application entirely from view (even the TaskBar) and restore it to view exactly as it was before it was hidden.

- Added OnMouseEnter and OnMouseExit events.

- Automatic "uncluttering" of the Windows 95 / NT TaskBar in Delphi 1.0 by hiding of all non MainForm TaskBar icons.  This feature is controlled by the toUnclutterDelphi1TaskBar Option of the Options property.

- Fixed a 16bit Windows NT 4.0 bug that stopped the TrayIcon from displaying itself in the system tray.

- Exposed the following properties:  Handle, Form, ClickedMouseButton.